package 字符串;

import java.util.Scanner;

/**
 * @Author Weton Li
 * @Date 2021/3/30 09:07
 */
public class 实现strStr {
    public static int strStr(String big, String small) {
        int bigLen = big.length();
        int smallLen = small.length();

        for (int i = 0; i < bigLen - smallLen + 1; i++) { // 判断bigLen-smallLen+1次
            if ((big.substring(i, i + smallLen)).equals(small)) { // 此处判断字符串是否相等，用.equals判断
                return i;

            }
        }
        return -1;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s1 = scanner.nextLine();
        String s2 = scanner.nextLine();
        System.out.println(strStr(s1, s2));
    }
}
